#pragma once


#include <string>
#include <CVector.h>
#include <CIniFile.h>
#include <perlin.h>


using namespace std;


class CRenderingParams {
 public:
  double idx;
  double idxCount;
  CVector camera;
  CVector up;
  CVector target;
  CVector direction;

  double detailLevel;

  double seed;
  double size; // pixels

  double no_procs;
  double rank;

  double terminate;
  double rayStep;

  double wavelength;

  double cameraWidth;
  double cameraAspectRatio;

  double lensing;

  double* dataBuffer;
  double bufferSize;
  Perlin* perlin;

  double randomize_spectra;

  CRenderingParams() {
    dataBuffer = (double*)this;
    bufferSize = (sizeof(CRenderingParams)-3)/8;
    perlin = 0;
  }

  ~CRenderingParams() {
  }

  void loadFromIni(string inifile) {
    CIniFile ini(inifile);
    
    camera = ini.getvector("camera");
    target = ini.getvector("target");
    up = ini.getvector("up");
    rayStep = ini.getdouble("raystep");

    seed = ini.getdouble("seed");

    cameraWidth = ini.getdouble("camera_width");
    cameraAspectRatio = ini.getdouble("camera_aspect_ratio");

    lensing = ini.getdouble("lensing");

    detailLevel = ini.getdouble("detail_level");

    randomize_spectra = ini.getdouble("randomize_spectra");

  }


};
